package BehavioralPatterns.Memento;

public class Test {

  public static void main(String[] args) {

    Originator originator = new Originator();
    CareTaker careTaker = new CareTaker();
    originator.setState("BehavioralPatterns.State 1");
    careTaker.add(originator.saveStateToMemento());

    originator.setState("BehavioralPatterns.State 2");
    careTaker.add(originator.saveStateToMemento());

    System.out.println(originator.getState());

    originator.getStateFromMemento(careTaker.getState(0));
    System.out.println(originator.getState());


  }
}
